package com.yunji.storage.enums;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.enums
 * @Title: RepairStatus
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-28 10:17:42      V1.0        HuaAo       新建类
 */

public enum RepairStatus {

    DRAFT(0, "草稿"),
    COMMIT(1, "已提交"),
    WAIT_INTO_STORAGE(2, "待入库"),
    FINISH(3, "已完成"),
    CANCEL(4, "已取消"),
    SCRAP(5, "作废");

    private final Integer code;
    private final String text;

    RepairStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code) {
        RepairStatus[] enums = RepairStatus.values();
        for (RepairStatus e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }

}